--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Commit 3fedd0af30bad0d0a61f92e4e3e8cff4f6f50a94
Parents : 34e0bde
Author : Mark Qvist <mark@unsigned.io>
Date : 2025-10-29T23:19:33+01:00
Added separate LXMF PN message size and sync transfer size limits
Changes
4 files changed, 31 insertions(+), 14 deletions(-)
Diff
diff --git a/nomadnet/Directory.py b/nomadnet/Directory.py
index ac03155..b9089f8 100644
--- a/nomadnet/Directory.py
+++ b/nomadnet/Directory.py
@@ -193,7 +193,8 @@ class Directory:
found_node = True
break
- if not found_node:
+ # TODO: Remove debug and rethink this (needs way to set PN when node is saved)
+ if True or not found_node:
if self.app.compact_stream:
try:
remove_announces = []
diff --git a/nomadnet/NomadNetworkApp.py b/nomadnet/NomadNetworkApp.py
index 73386cf..462bcce 100644
--- a/nomadnet/NomadNetworkApp.py
+++ b/nomadnet/NomadNetworkApp.py
@@ -128,6 +128,7 @@ class NomadNetworkApp:
self.notify_on_new_message = True
self.lxmf_max_propagation_size = None
+ self.lxmf_max_sync_size = None
self.lxmf_max_incoming_size = None
self.periodic_lxmf_sync = True
@@ -302,7 +303,7 @@ class NomadNetworkApp:
self.message_router = LXMF.LXMRouter(
identity = self.identity, storagepath = self.storagepath, autopeer = True,
- propagation_limit = self.lxmf_max_propagation_size, delivery_limit = self.lxmf_max_incoming_size,
+ propagation_limit = self.lxmf_max_propagation_size, sync_limit = self.lxmf_max_sync_size, delivery_limit = self.lxmf_max_incoming_size,
max_peers = self.max_peers, static_peers = static_peers,
)
@@ -888,6 +889,14 @@ class NomadNetworkApp:
value = 1
self.lxmf_max_propagation_size = value
+ if not "max_sync_size" in self.config["node"]:
+ self.lxmf_max_sync_size = 256*40
+ else:
+ value = self.config["node"].as_float("max_sync_size")
+ if value < self.lxmf_max_propagation_size:
+ value = self.lxmf_max_propagation_size
+ self.lxmf_max_sync_size = value
+
if not "announce_at_start" in self.config["node"]:
self.node_announce_at_start = False
else:
@@ -1182,16 +1191,20 @@ disable_propagation = Yes
# message_storage_limit = 2000
# The maximum accepted transfer size per in-
-# coming propagation transfer, in kilobytes.
-# This also sets the upper limit for the size
-# of single messages accepted onto this node.
+# coming propagation message, in kilobytes.
+# This sets the upper limit for the size of
+# single messages accepted onto this node.
+max_transfer_size = 256
+
+# The maximum accepted transfer size per in-
+# coming propagation node sync.
#
# If a node wants to propagate a larger number
# of messages to this node, than what can fit
# within this limit, it will prioritise sending
-# the smallest, newest messages first, and try
+# the smallest messages first, and try again
# with any remaining messages at a later point.
-max_transfer_size = 256
+max_sync_size = 10240
# You can tell the LXMF message router to
# prioritise storage for one or more
diff --git a/nomadnet/_version.py b/nomadnet/_version.py
index 777f190..8088f75 100644
--- a/nomadnet/_version.py
+++ b/nomadnet/_version.py
@@ -1 +1 @@
-__version__ = "0.8.0"
+__version__ = "0.8.1"
diff --git a/nomadnet/ui/textui/Network.py b/nomadnet/ui/textui/Network.py
index 63f00ec..e59dc1a 100644
--- a/nomadnet/ui/textui/Network.py
+++ b/nomadnet/ui/textui/Network.py
@@ -1843,15 +1843,18 @@ class LXMFPeerEntry(urwid.WidgetWrap):
style = "list_unresponsive"
focus_style = "list_focus_unresponsive"
- if peer.propagation_transfer_limit:
- txfer_limit = RNS.prettysize(peer.propagation_transfer_limit*1000)
- else:
- txfer_limit = "No"
+ if peer.propagation_transfer_limit: txfer_limit = RNS.prettysize(peer.propagation_transfer_limit*1000)
+ else: txfer_limit = "No"
+
+ if peer.propagation_sync_limit: sync_limit = RNS.prettysize(peer.propagation_sync_limit*1000)
+ else: sync_limit = "Unknown"
+
ar = round(peer.acceptance_rate*100, 2)
peer_info_str = sym+" "+display_str+"\n "+alive_string+", last heard "+pretty_date(int(peer.last_heard))
- peer_info_str += "\n "+str(peer.unhandled_message_count)+f" unhandled LXMs, {txfer_limit} sync limit\n"
+ peer_info_str += f"\n {sync_limit} sync limit, {txfer_limit} msg limit\n"
peer_info_str += f" {RNS.prettyspeed(peer.sync_transfer_rate)} STR, "
- peer_info_str += f"{RNS.prettyspeed(peer.link_establishment_rate)} LER, {ar}% AR\n"
+ peer_info_str += f"{RNS.prettyspeed(peer.link_establishment_rate)} LER"
+ peer_info_str += "\n "+str(peer.unhandled_message_count)+f" unhandled LXMs, {ar}% AR"
widget = ListEntry(peer_info_str)
self.display_widget = urwid.AttrMap(widget, style, focus_style)
self.display_widget.destination_hash = destination_hash
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────